#include <iostream>
#include "company.h"

using namespace std;

void Company::inputEmployee()
{
	//Task 1: please implement this!
	while (1 == 1) {
		bestPaid.input();
		string n = bestPaid.getName();
		if (n == "*") break;
		else if (n != "*") empContainer.addHead(bestPaid);
	}
}

void Company::findBestPaid()
{
	//Task 2: please implement this!
	
	ListCont<Employee>::Iterator it;
	it = empContainer.Begin();
	while (true)
	{
		if (it == empContainer.End()) break;
		if ((*it) > bestPaid) bestPaid = (*it);
		it++;
	}
}

void Company::printBestPaid() const
{
	cout << "The best-paid employee and gross pay: " << endl;
	bestPaid.output();
} // printBestPaid
